package org.tekmob.remindpal;

import org.tekmob.remindpal.controller.ShowReminder;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
/**
 * MainActivity of application
 * Show the splash screen
 * 
 * @author Annisa
 *
 */
@SuppressLint("NewApi")
public class MainActivity extends Activity {

	private final int SPLASH_DISPLAY_LENGHT = 1000;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.activity_main);

		/* New Handler to start the Menu-Activity 
		 * and close this Splash-Screen after some seconds.*/
		new Handler().postDelayed(new Runnable(){
			@Override
			public void run() {
				Button start = (Button) findViewById(R.id.start);

				start.setOnClickListener(new OnClickListener(){
					@Override
					public void onClick(View arg0) {
						// TODO Auto-generated method stub
						Intent myRemindPal = new Intent(getApplicationContext(),ShowReminder.class);
						startActivity(myRemindPal);
					}
				});    }
		}, SPLASH_DISPLAY_LENGHT);


	}
}
